<?php 
if(file_exists(JS_INCLUDE_PATH.'JqueryFooter.php'))
{ require(JS_INCLUDE_PATH.'/JqueryFooter.php'); }
?>
<?php if(!((BOOTSTRAP > 0) || ($theme->getBootstrap() > 0))): ?>
<script type="text/javascript" src="<?php echo JS_INCLUDE_URL; ?>jquery/plugins/jquery.formalize.min.js"></script>
<?php endif; ?>
<?php if(file_exists(JS_INCLUDE_PATH.'katana.jq.onload.js')): ?>
<script type="text/javascript" src="<?php echo JS_INCLUDE_URL; ?>katana.jq.onload.js"></script>
<?php endif; ?>
<?php if($theme->getBootstrap() > 2): ?>
<script type="text/javascript" src="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/3.1.0/js/bootstrap.min.js"></script>
<?php else:  ?>
	<?php if($theme->getBootstrap() > 0): ?>
	<script type="text/javascript" src="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/js/bootstrap.min.js"></script>
	<?php else:  ?>
	<script type="text/javascript" src="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/js/affix.js"></script>
	<script type="text/javascript" src="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/js/collapse.js"></script>
	<?php endif; ?>
<?php endif; ?>
<?php if(file_exists(TEMPLATES_PATH.'sites/'.$katana->getId().'/layout/autojs/menu.js')): ?>
<script type="text/javascript" src="<?php echo TEMPLATES_URL; ?>sites/<?php echo $katana->getId(); ?>/layout/autojs/menu.js"></script>
<?php endif; ?>
<?php if(file_exists(TEMPLATES_PATH.'sites/'.$katana->getId().'/layout/autojs/auto.js')): ?>
<script type="text/javascript" src="<?php echo TEMPLATES_URL; ?>sites/<?php echo $katana->getId(); ?>/layout/autojs/auto.js?id=<?php echo date('his'); ?>"></script>
<?php endif; ?>
<?php if($sitemap->getSetting('g-plusone') > 0): ?>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"> { lang: '<?php echo $katana->Language; ?>'} </script>
<?php endif; ?>
<?php if(is_object($adc) && (GOOGLE_API_KEY != '')): ?>
	<?php if(is_object($adc->getCurrentAd())): ?>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=<?php echo GOOGLE_API_KEY; ?>&amp;sensor=false"></script>
	<?php endif; ?>
<?php endif; ?>
<?php 
if(file_exists(TEMPLATES_PATH.'sites/'.$katana->Id.'/layout/elements/footer/analytics.php'))
{ require(TEMPLATES_PATH.'sites/'.$katana->Id.'/layout/elements/footer/analytics.php'); }
else
{ require(TEMPLATES_CORE_PATH.'/layout/elements/footer/analytics.php'); }
?>
<script type="text/javascript">
<?php if($_REQUEST['print'] > 0) { echo 'javascript:window.print();'; } ?>
<?php if(defined('RUN_IFRAME')): ?>
jQuery(document).ready(function() 
{ jQuery('a').attr('target', '_blank'); });
<?php endif; ?>
<?php if($katana->getComId() > 0): ?>
window.onbeforeunload = function () 
{ jQuery.cookie("scroll", document.documentElement.scrollTop, { expires: 7 }); }
<?php endif; ?>
<?php if(($sitemap->getSetting('twitter-share') > 0) || ($sitemap->getSetting('twitter-follow') != '')): ?>
/* Twitter */
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
/* Twitter End */
<?php endif; ?>
<?php if($sitemap->getSetting('FbAppId') != ''): ?>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/nb_NO/all.js#xfbml=1&appId=<?php echo $sitemap->getSetting('FbAppId'); ?>";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
<?php endif; ?>
</script>
<?php if(file_exists(JS_INCLUDE_PATH.'forms.js')): ?>
<script type="text/javascript" src="<?php echo JS_INCLUDE_URL; ?>forms.js"></script>
<?php endif; ?>
<?php if(file_exists(JS_INCLUDE_PATH.'global.js')): ?>
<script type="text/javascript" src="<?php echo JS_INCLUDE_URL; ?>global.js"></script>
<?php endif; ?>